import { createApp } from 'vue'
import store from './store'
import * as Icons from "@element-plus/icons-vue";
import plainText from './directive/plainText'
import safeHtml from './directive/safeHtml'
// import { useI18n } from "../config/i18n.js";
import { MessageBox } from '../utils/oldapp/third-lib'
import initConfig from "@utils/oldapp/init-config";
import EventBus from '@/render/utils/eventbus'
import "element-plus/dist/index.css";
// import 'virtual:svg-icons-register'

import App from './App.vue'
import router from './router'
// import { injectResponsiveStorage } from "@/utils/responsive.ts";
// import SvgIcon from "@common/SvgIcon/index.js";

const app = createApp(App)
app.use(MessageBox)
Object.keys(Icons).forEach(key => {
  app.component(key, Icons[key]);
});
// getAppConfig(app).then(async config => {
app.use(store)
app.use(router)
// await router.isReady();
// injectResponsiveStorage(app, config);
app.use(initConfig)
const $bus = new EventBus()
app.provide('$bus', $bus)
// 挂载到this上
app.config.globalProperties.$bus = $bus
// app.use(useI18n)
app.use(plainText)
app.use(safeHtml)
// app.use(SvgIcon)

app.mount('#app')
// });
  